<?php
defined('JPATH_BASE') or die();

jimport('joomla.filesystem.file'); 
jimport('joomla.filesystem.folder'); 

class JElementAccess extends JElement
{ 
	
	
	function fetchElement($name, $value, &$node, $control_name)
	{ 
	
		$db=JFactory::getDBO();
		$query	=	"SELECT * FROM #__groups";
		$db->setQuery($query);
		$group	=	$db->loadObjectList();
		
		$lists=	JHTML::_('select.genericlist', $group, $control_name.'['.$name.']', 'class="inputbox" size="1"', 'id', 'name', $value);
		ob_start();
	echo $lists;
		$return = ob_get_contents();
		ob_end_clean();		
		return $return;
	 
	}

}
